package com.sample.Tetris;

import android.graphics.Color;
import android.util.Log;

public class SShape extends Shape {
int[] tempCoords=new int[8];	
	public SShape(){
		color=Color.GREEN;	
		coords[0]=5;
		coords[1]=0;
		coords[2]=4;
		coords[3]=0;
		coords[4]=4;
		coords[5]=1;
		coords[6]=3;
		coords[7]=1;
		}
	public int[] turn(int direction){
		if(state==1){
		tempCoords[0]=coords[0]-2;	
		tempCoords[1]=coords[1]-1;
		tempCoords[2]=coords[2]-1;
		tempCoords[3]=coords[3];
		tempCoords[4]=coords[4];
		tempCoords[5]=coords[5]-1;
		tempCoords[6]=coords[6]+1;
		tempCoords[7]=coords[7];
		state=2;
		}
		else if(state==2){
		tempCoords[0]=coords[0]+2;	
		tempCoords[1]=coords[1]+1;
		tempCoords[2]=coords[2]+1;
		tempCoords[3]=coords[3];
		tempCoords[4]=coords[4];
		tempCoords[5]=coords[5]+1;
		tempCoords[6]=coords[6]-1;
		tempCoords[7]=coords[7];	
		state=1;	
		}
		return tempCoords;	
		}
}
